<?php

// Get posted array of users

// Spit out newline delimited list of public key n

$users = $_POST['users'];

$usersarray = explode(",", $users);

foreach ($usersarray as $user){
	require("./dbconnect.inc.php");

	// Process
	mysql_connect($host,$dbuser,$dbpassword);
	@mysql_select_db($database) or die( "Unable to select database");

	// Grab data
	$datagrab=sprintf("SELECT * FROM users WHERE username='%s'", mysql_real_escape_string($user));


	$dataresult=mysql_query($datagrab);
	$numdata=mysql_numrows($dataresult);

	$j=0;
	while($j < $numdata){
	$key=mysql_result($dataresult,$j,"pk_n");
	
		if(isset($returnstring)){
			$returnstring.="\n".$key;
		}
		else{
			$returnstring.=$key;
		}
	
	$j++;
	}
}

echo $returnstring;


?>